window.onload=function(){
      var submenu=$(".submenu li");
    submenu.click(function(){
        $("#could_web").show();

    });

    
    var product1=$(".product1");
    
    for(var i=0;i<submenu.length;i++){
        submenu[i].index=i;
        submenu[i].onclick=function(){
            for(var i=0;i<submenu.length;i++){
                submenu[i].className='';
                product1[i].style.display='none';
            }
            product1[this.index].style.display='block';
        }
    }


var set_head=$(".set_head>ul>li");
var set_head1=$(".set_head1>ul>li");
var set_head4=$(".case_head>.set_head4");
var news_head=$(".news_head>ul>li");
var scren=$(".screens_head>ul>li");
var set2=$(".set2");
var set=$(".set1");
var set4=$(".set4");
var set5=$(".set5");
var set15=$(".set15");

for(var i=0;i<set_head.length;i++){
    set_head[i].index=i;
    set_head[i].onclick=function()
    {

        for(var i=0;i<set_head.length;i++){
            set_head[i].className='';
            set[i].style.display='none';

        }
        this.className='btn_color';
         set[this.index].style.display='block';
     }
 }

for( var i=0;i<set_head1.length;i++){
    set_head1[i].index=i;
    set_head1[i].onclick=function(){
        for(var i=0;i<set_head1.length;i++){
            set_head1[i].className='';
            set2[i].style.display="none";
        }
        this.className='btn_color';
        set2[this.index].style.display='block';
        }
    }

    for( var i=0;i<set_head4.length;i++){
    set_head4[i].index=i;
    set_head4[i].onclick=function(){
        for(var i=0;i<set_head4.length;i++){
            set_head4[i].className='';
            set4[i].style.display="none";
        }
        this.className='btn_color';
        set4[this.index].style.display='block';
        }
    }

     for( var i=0;i<news_head.length;i++){
    news_head[i].index=i;
    news_head[i].onclick=function(){
        for(var i=0;i<news_head.length;i++){
            news_head[i].className='';
            set15[i].style.display="none";
        }
        this.className='btn_color';
        set15[this.index].style.display='block';
        }
    }
/*三屏主站按钮切换*/
 for( var i=0;i<scren.length;i++){
    scren[i].index=i;
    scren[i].onclick=function(){
        for(var i=0;i<scren.length;i++){
            scren[i].className='';
            set5[i].style.display="none";
        }
        this.className='screen_color';
        set5[this.index].style.display='block';
        }
    }
/*二维码生成*/
    var generation_head=$(".generation_head ul li");
    var card1=$(".card1");
    for(var i=0;i<generation_head.length;i++){
        generation_head[i].index=i;
        generation_head[i].onclick=function(){
            for(var i=0;i<generation_head.length;i++){
                generation_head[i].className='';
                card1[i].style.display='none';
            }
            this.className='cord_color';
            card1[this.index].style.display='block';
        }
    }


/*添加代码所有产品*/
var titl=$(".Increase_input>ul>li:eq(1)>input")
var increse_select=$("#increase_select");
var file_picture=$(".picture_file input")
var seque=$(".Increase_input>ul>li:eq(5)>input")
$("#incra_btn").click(function(){
    var tr="<tr><td><input type=\"checkbox\" name=\"check\"/>"+"</td><td>"+titl.val()+"</td><td>"+increse_select.val()+"</td><td><p>"+file_picture.val()+"</p></td><td>"+seque.val()+"</td></tr>";
    $("#pro_table").append(tr);
});




$("#pro_dele").click(function(){
    var check=document.getElementsByName("check");
    for(var i=0;i<check.length;i++){
        if (check[i].checked==true) {
            document.getElementById("pro_table").deleteRow(i);
           i--;
        }
    }
});

/*广告设置案例*/
var adver_picture=$(".adver_input ul li:eq(0)>input");
var adver_add=$(".adver_input ul li:eq(1)>input");
var ti=$(".adver_input ul li:eq(2)>input");
var adver_btn=$(".adver_input ul li:eq(3)>input");
adver_btn.click(function(){
	var adver_tr="<tr><td><p>"+adver_picture.val()+"</p></td><td>"+adver_add.val()+"</td><td>"+ti.val()+"</td><td><a class=\"adver_a\" href='#'>删除</a></td></tr>";
	$("#adver_tabl").append(adver_tr);
	$("#adver_tabl .adver_a").click(moveEle);

});
$("#adver_tabl .adver_a").click(moveEle);//点击按钮移除该行
function moveEle(){
	var tr_a=$(this).parent().parent();
	tr_a.remove();
}

/*产品设置分类管理页面*/
 var Increase_txt=$(".Increase .Increase_input li:eq(0) input");
 var  Increase_paixu=$(".Increase .Increase_input li:eq(1) input");
 var Increase_tijiao=$(".Increase_input .product_button");
 Increase_tijiao.click(function(){
 	var Increase_tr="<tr><td><input type=\"checkbox\" name=\"tijiao_check\"/>"+"</td><td>"+Increase_txt.val()+"</td><td>"+Increase_paixu.val()+"</td></tr>"
 	$("#Incras").append(Increase_tr);
 })
  $("#sort>p>input").click(function(){
 	var tijiao_check=document.getElementsByName("tijiao_check");
 	for(var i=0;i<tijiao_check.length;i++){
 		if(tijiao_check[i].checked==true){
 			document.getElementById("Incras").deleteRow(i);
 			i--;
 		}
 	}
 })
/*团队图片添加管理*/
var case_btn=$(".case_input li.button input");
var case_pic=$(".case_input li:eq(0) input");
var case_biaoti=$(".case_input .biaoti input");
var case_paixu=$(".case_input li:eq(2) input");
case_btn.click(function(){
	var case_tr="<tr><td><input type=\"checkbox\" name=\"case_check\"/>"+"</td><td>"+case_pic.val()+"</td><td>"+case_biaoti.val()+"</td><td>"+case_paixu.val()+"</td><td><a class=\"case_a\" href='#'>删除</a></td></tr>"
	$("#team_table").append(case_tr);
	$("#team_table .case_a").click(case_remove);
	alert("保存成功");
	 case_biaoti.value=" ";
	})
$("#team_table .case_a").click(case_remove);//点击按钮移除该行
function case_remove(){
	var case_tr=$(this).parent().parent();
	case_tr.remove();
}

$("#team_border>p>input").click(function(){
	var case_check=document.getElementsByName("case_check");
	for(var i=0;i<case_check.length;i++){
		if(case_check[i].checked==true){
			document.getElementById("team_table").deleteRow(i);
			i--;
			}
		}
	})

/*产品设置添加分类*/
var fenlei=$(".Increase_input input:eq(0)");
var fenlei_btn=$(".Increase_input .product_button");
fenlei_btn.click(function(){
	var tianjia_option="<option>"+fenlei.val()+"</option>";
	$("#increase_select").append(tianjia_option);
});


/*验证表单不能为空*/


/*qq客服*/
    var choose=$(".qq_muban ul li p");
    for(var i=0;i<choose.length;i++){
        choose[i].onclick=function(){
            for(i=0;i<choose.length;i++){
                choose[i].className='';
            }
           this.className='qq_color';
            
        }

    }
/*qq客服在线弹出框*/
 var depart_btn=$("#department>p>input");
 var popping=$("#popping");
 var close=$("#popping>p>span");
 depart_btn.click(function(){
    if(popping.is(":hidden")){
        popping.show();
    }
})
 close.click(function(){
    popping.hide();
 })


var poe_btn=$("#popping .reset .popp_btn");//选中qq在线客服弹出框的保存按钮
var poe_qq=$("#popping form div:eq(0) input");
var poe_name=$("#popping form div:eq(1) input");
var poe_department=$("#popping form select");
poe_btn.click(function(){
	
		var poe_form="<tr><td>"+poe_qq.val()+"</td><td>"+poe_name.val()+"</td><td>"+poe_department.val()+"</td><td><a class=\"depart_a\" href='#'>删除</a></td></tr>";
		$(".depart_tab").append(poe_form);
	$(".depart_tab .depart_a").click(depart_remove);
	alert("保存成功");
	$("#popping").hide();
	});
	$(".depart_tab .depart_a").click(depart_remove);
	function depart_remove(){//点击按钮删除信息
		var depart_tr=$(this).parent().parent();
		depart_tr.remove();
		}

var submit_btn=$(".submit_btn");
for(var i=0;i<submit_btn.length;i++){
	submit_btn[i].onclick=function(){
		alert("保存成功");

	}
} 
var liuyan=$(".liuyan");
for( var i=0;i<liuyan.length;i++){//遍历所有留言
 liuyan[i].onclick=function(){//点击按钮
	 	alert("对不起，您没有权限访问");
		window.location.reload();
		
	 }
}
var mokuai=$(".screens_head ul .screen_mokuai");
for(var i=0;i<mokuai.length;i++){
	mokuai[i].onclick=function(){
	alert("抱歉，您的权限不够");
	window.location.reload();
	
	}
}

/*新闻软文发布草稿箱*/
var caogao=$(".news_main p:last-child input:first-child");
var biaoti=$(".news_main p:first-child input");
var myDate = new Date();
var myTime=myDate.toLocaleString();
var news_tab=$(".rough_tab table");
caogao.click(function(){
	var news_tr="<tr><td><input type=\"checkbox\" name=\"news_check\"/>"+"</td><td>"+biaoti.val()+"</td><td>"+myTime+"</td><td><a class=\"news_a\" href='#'>删除</a></td></tr>"
	news_tab.append(news_tr);
	alert("保存成功")
	$("#news_table .news_a").click(news_remove);
	})
$("#news_table .news_a").click(news_remove);
function news_remove(){
	var news_a=$(this).parent().parent();
	news_a.remove();
	
	}
$("#rough>p").click(function(){
	var news_delete=document.getElementsByName("news_check");
	for(var i=0;i<news_delete.length;i++){
		if(news_delete[i].checked==true){
			document.getElementById("news_table").deleteRow(i);
			i--;
			}
			
		}
	})
	
/*团队案例*/
var client_delete=$("#client_border>p");
var client_pic=$(".case_input ul li:eq(0) input");
var client_title=$(".case_input ul li:eq(1) input");
var client_sort=$(".case_input ul li:eq(2) input");
var client_btn=$(".case_input .button input");
client_btn.click(function(){
	var client_tr="<tr><td><input type=\"checkbox\" name=\"client_check\"/>"+"</td><td>"+client_pic.val()+"</td><td>"+client_title.val()+"</td><td>"+client_sort.val()+"</td><td><a class=\"client_a\" href='#'>删除</a></td></tr>"
	$("#client_table").append(client_tr);
	$("#client_table .client_a").click(client_remove);
	})
$("#client_table .client_a").click(client_remove);
function client_remove(){
	var client_a=$(this).parent().parent();
	client_a.remove();
	}

client_delete.click(function(){
	var client_check=document.getElementsByName("client_check");
	for(var i=0;i<client_check.length;i++){
		if(client_check[i].checked){
			document.getElementById("client_table").deleteRow(i);
			}
		}
	})
}//结束



       
